package com.qf.electronic.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.electronic.dto.TowerDto;
import com.qf.electronic.pojo.Tower;
import com.qf.electronic.mapper.TowerMapper;
import com.qf.electronic.service.ITowerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.electronic.vo.TowerVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wu
 * @since 2023-05-04
 */
@Service
public class TowerServiceImpl extends ServiceImpl<TowerMapper, Tower> implements ITowerService {

    @Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED)
    @Override
    public Page<TowerVo> searchTowers(TowerDto towerDto) {
        Page<TowerVo> page = new Page<>(towerDto.getCurrentPage(), towerDto.getPageSize());
        return this.baseMapper.getTowers(page, towerDto);
    }
}
